import {
    input,
} from '@/css/DialogsCss.module.scss';

export default {
    title: '客户分配',
    dialog: {
        width: 600,
        type: 'dialog'
    },
    onMounted: [{
        action: 'set',
        target: '$view',
        field: 'title',
        value: '$params.title'
    }, {
        action: 'set',
        target: '$widgets.form',
        field: 'value',
        value: '$params.form'
    }],
    items: [{
        region: 'center',
        layout: 'vertical',
        items: [{
            layout: 'vertical',
            items: [
                {
                    id: 'form',
                    widget: 'form',
                    fields: [{
                        class: input,
                        itemId: 'salesman',
                        widget: 'select',
                        dictionary: 'customers_pool/public/distribution/salesman',
                        label: '指定销售联系人',
                    }],
                    buttons: [{
                        value: '保存',
                        type: 'primary',
                        onClick: [{
                            action: 'confirm',
                            title: '表单保存',
                            message: '是否保存表单?',
                            confirm: [{
                                var: 'value',
                                target: '$widget',
                                action: 'call',
                                method: 'getValue'
                            }, {
                                action: 'service',
                                path: 'customers_pool/public/distribution/save',
                                params: '$vars.value'
                            }, {
                                action: 'dialog-hide',
                                mode: 'apply'
                            }]
                        }]
                    }],
                    flex: true
                }]
        }]
    }]
};


